package com.xyzwps.server.paimon.common

data class CursorPage<T, C>(
    val items: List<T>,
    val nextCursor: C,
    val hasMore: Boolean
) {
    fun <R> map(mapper: (T) -> R): CursorPage<R, C> {
        return CursorPage(items.map(mapper), nextCursor, hasMore)
    }

    fun <R> transfer(mapper: (List<T>) -> List<R>): CursorPage<R, C> {
        return CursorPage(mapper(items), nextCursor, hasMore)
    }
}
